#!/bin/bash

source ./common.sh

echo "当前目录：$dir"
echo "脚本版本：$version"

files=(
  "01.flowable.mysql.create.common.sql"
  "02.flowable.mysql.create.variable.sql"
  "03.flowable.mysql.create.variable.history.sql"
  "04.flowable.mysql.create.task.sql"
  "05.flowable.mysql.create.task.history.sql"
  "06.flowable.mysql.create.job.sql"
  "07.flowable.mysql.create.identitylink.sql"
  "08.flowable.mysql.create.identity.sql"
  "09.flowable.mysql.create.identitylink.history.sql"
  "10.flowable.mysql.create.entitylink.sql"
  "11.flowable.mysql.create.entitylink.history.sql"
  "12.flowable.mysql.create.eventsubscription.sql"
  "13.flowable.mysql.create.history.sql"
  "14.flowable.mysql.create.engine.sql"
  "15.flowable.mysql.cmmn.create.sql"
  "16.flowable.mysql.create.batch.sql"
)

# 使用for循环遍历数组
for file in "${files[@]}"; do
  # 执行脚本
  mysql --host=$mysql_host --port=$mysql_port --database=$mysql_db --user=$mysql_username --password=$mysql_password --verbose < "$dir/../1.init-flowable/mysql/$file"
done